import 'package:flutter/material.dart';

class CoreDataClipper extends CustomClipper<Path> {
  @override
  Path getClip(Size size) {
    var path = Path();
    // 第一个点
    path.lineTo(0, 0);
    // 第二个点

    path.lineTo(0, size.height - 10);
    var firstPoint = Offset(size.width / 2, size.height);
    var endPoint = Offset(size.width, size.height - 10);
    path.quadraticBezierTo(
        firstPoint.dx, firstPoint.dy, endPoint.dx, endPoint.dy);
    // 第三个点
    path.lineTo(size.width, size.height - 10);
    // 第四个点
    path.lineTo(size.width, 0);

    return path;
  }

  @override
  bool shouldReclip(covariant CustomClipper<Path> oldClipper) {
    return true;
  }
}
